]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
browser-plugin: Set windowless mode and don't claim to need XEmbed
authorCarlos Garcia Campos <cgarcia@igalia.com>
Wed, 11 Nov 2015 11:30:24 +0000 (12:30 +0100)
committerMichael Catanzaro <mcatanzaro@gnome.org>
Tue, 17 Nov 2015 17:35:03 +0000 (11:35 -0600)
NPAPI plugins are windowed by default, so we need to set
NPPVpluginWindowBool value to FALSE on startup. This way the browser
will not create a GtkSocket for a GtkPlug that we are not going to
create. It doesn't make sense to claim that we need XEmbed either.

https://bugzilla.gnome.org/show_bug.cgi?id=757940

browser-plugin/browser-plugin.c

index 46dacae275e3a8019355866f0a6f760da95fa9cc..dbeac336e79c74b1aec381a19092d85fb4f72004 100644 (file)
@@ -162,6 +162,7 @@ NP_Initialize(NPNetscapeFuncs *pfuncs, NPPluginFuncs *plugin)
   plugin->destroy = NPP_Destroy;
   plugin->getvalue = NPP_GetValue;
   plugin->setwindow = NPP_SetWindow;
+  plugin->event = NPP_HandleEvent;
 
   return NPERR_NO_ERROR;
 }
@@ -218,6 +219,9 @@ NPP_New(NPMIMEType    mimetype,
   data = g_slice_new (PluginData);
   instance->pdata = data;
 
+  /* set windowless mode */
+  funcs.setvalue(instance, NPPVpluginWindowBool, NULL);
+
   data->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
                                                G_DBUS_PROXY_FLAGS_NONE,
                                                NULL, /* interface info */
@@ -1034,10 +1038,6 @@ NPP_GetValue(NPP          instance,
     *(NPObject**)value = funcs.createobject (instance, &plugin_class);
     break;
 
-  case NPPVpluginNeedsXEmbed:
-    *(bool *)value = TRUE;
-    break;
-
   default:
     ;
   }
@@ -1053,3 +1053,11 @@ NPP_SetWindow(NPP          instance,
 {
   return NPERR_NO_ERROR;
 }
+
+int16_t
+NPP_HandleEvent(NPP   instance,
+                void *event)
+{
+  /* Ignore the event */
+  return FALSE;
+}